package com.example.speeddating.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.Setter;

/**
 *
 * @author tina
 * @since 2023-06-28 11:14:33
 */
@Getter
@Setter
public class Article implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 用户id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long userId;

    /**
     * 内容
     */
    private String content;

    /**
     * 定位
     */
    private String location;

    /**
     * 图片
     */

    @TableField(exist = false)
    private List<String> images;

    /**
     * 评论数
     */
    @TableField(exist = false)
    private int commentNum;

    /**
     * 点赞数
     */
    @TableField(exist = false)
    private int thumpNum;

    /**
     * 发布时间
     */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", locale = "zh", timezone = "GMT+8")
    private Date createTime;

    /**
     * 话题
     */

    private Integer topicId;

    @TableField(exist = false)
    private Topic topic;

    /**
     * 话题名称
     */
    @TableField(exist = false)
    private String talk;

    /**
     * 是否通过审核
     */
    private Boolean pass;

    /**
     * 是否删除
     */
    @TableLogic
    private Integer deleted;

    @TableField(exist = false)
    private Boolean isLike;

    @TableField(exist = false)
    private List<String> urls; //头像组


}
